package vue.components;

import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;

import controler.Joueur;

import vue.Ui;

public class TPButton extends JButton {

	private static final long serialVersionUID = 1L;
	public Ui ui;
	public String mouseEntered = "";
	public String mouseExited = "";
	
	public TPButton() {
		initComponent();
	}
	
	public void initComponent(){
        setFont(getFont().deriveFont(getFont().getStyle() | java.awt.Font.BOLD, getFont().getSize()+3));
	    setForeground(new Color(255, 50, 0));
	    setBorder(null);
	    setBorderPainted(false);
	    setContentAreaFilled(false);
	    addMouseListener(new MouseAdapter() {
            public void mouseEntered(MouseEvent evt) {
            	if(Joueur.ui != null){
            		Joueur.ui.statutPanel.setInfo(mouseEntered);
            	}
                setBorderPainted(true);
                setForeground(new Color(0,186,255) ); // test
            }
            public void mouseExited(MouseEvent evt) {
            	if(Joueur.ui != null){
            		Joueur.ui.statutPanel.setInfo(mouseExited);
            	}
            	setBorderPainted(false);
            	setForeground(new Color(255, 50, 0));
            }
        });
	}
}
